package com.boot.controller;

import com.boot.config.DBConfig;
import com.boot.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {

//    @Autowired
//    User user;//因为这时候User的bean已经被Spring创建并放到容器中

    @Autowired
    DBConfig dbConfig;

    @RequestMapping("/index")
    //@ResponseBody //这样就是直接返回字符串
    public String index(){
        //return "哈哈哈哈";//转发到index页面

//        System.out.println(user);
        System.out.println(dbConfig);

        return "index";
    }



}
